<%@page import="java.util.Iterator"%>
<%@page import="entities.*,dao.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <link href="style1.css" rel="stylesheet" type="text/css" />
        <title>faculty</title>
        <style type="text/css">
            <!--
            .style3 {color: #FF0000}
            -->
        </style>
    </head>

    <body>
        <div class="body">
            <div class="menu_top">Welcome, , <a href="#">Log out</a></div>
            <a href="#"><div class="banner"></div></a>
            <div class="menu_main">
                <a href="index.jsp">
                    <div class="sub_menu">
                        <h2 align="center">Home</h2>
                    </div></a>
                <a href="viewcourse.jsp">
                    <div class="sub_menu">
                        <h2 align="center">View Courses </h2>
                    </div></a>
                <a href="viewcoures.jsp">
                    <div class="sub_menu">
                        <h2 align="center">Answer</h2>
                    </div></a>
                <a href="changePassword.jsp">
                    <div class="sub_menu">
                        <h2 align="center">Change PWD </h2>
                    </div></a>
                <a href="about.jsp">
                    <div class="sub_menu">
                        <h2 align="center">About</h2>
                    </div></a>
                <a href="contact.jsp">
                    <div class="sub_menu">
                        <h2 align="center">Contact</h2>
                    </div></a>
            </div>
            <div class="livechat">
            </div>
            <a href="#"><div class="advert"></div></a>
            <!--<div class="cats">
                    <div class="title_color"> </div>
                    <div class="images"><img src="images/alert_8-20110809120456-00003.png" alt="y" width="110" height="95" /> </div>
                    <div class="content">
                      <h2 class="style3"><a href="#">Important Information</a></h2>
                      <p>Only members who has authentication can access this place </p>
                    </div>
                    <div class="content1">
                      <p>Only members who has authentication can access this place </p>
                    </div>
            </div>-->
            <div class="recentpost">
                <div id="top">
                </div> <%
                    QueryDao qd = new QueryDao();
                    for (Iterator it = qd.getListQuery().iterator(); it.hasNext();) {
                        Query q = (Query) it.next();
                        StudentDao sd = new StudentDao();
                        Student st = new Student();
                        st.setStudentid(q.getStudentid());
                        String url = "details_query.jsp?queryid=" + q.getQueryid();
                %>
                <div id="query">
                    <div class="images1"><img src="images/Letter512px.png" alt="k" width="50" height="44" /></div>

                    <div class="query_question">

                        <div id="title"><a href=<%=url%>><%=q.getTitle()%></a></div> 
                        <div id="post">Post by: <%

                            MemberDao memberDao = new MemberDao();%>
                            <%= memberDao.getUsernameByID(sd.getMemberIdOfStudent(st))%> </div>

                    </div><%  }
                    %>
                    <!--<div class="rate_post">-->
                    <!--<div id="answer">Answer: 15 </div>-->
                    <!--<div id="view">View: 7,589 </div>-->
                    <!--</div>-->
                </div>

                <!--	<div id="query">
                                <div class="images1"><img src="images/Letter512px.png" alt="k" width="50" height="44" /></div>
                                <div class="query_question">
                                        <div id="title"><a href="#">How to learn C# Programming Languages? </a></div>
                                        <div id="post">Post by: jimsheom </div>
                                </div>
                                <div class="rate_post">
                                        <div id="answer">Answer: 150 </div>
                                        <div id="view">View: 7,589 </div>
                                </div>
                        </div>
                        <div id="query">
                                <div class="images1"><img src="images/Letter512px.png" alt="k" width="50" height="44" /></div>
                                <div class="query_question">
                                        <div id="title"><a href="#">What's different bettween ADO.NET & JDBC </a></div>
                                        <div id="post">Post by: jimsheom </div>
                                </div>
                                <div class="rate_post">
                                        <div id="answer">Answer: 150 </div>
                                        <div id="view">View: 7,589 </div>
                                </div>
                        </div>
                        <div id="query">
                                <div class="images1"><img src="images/Letter512px.png" alt="k" width="50" height="44" /></div>
                                <div class="query_question">
                                        <div id="title"><a href="#">Who is the first person in the world had explored the Black Hole? </a></div>
                                        <div id="post">Post by: jimsheom </div>
                                </div>
                                <div class="rate_post">
                                        <div id="answer">Answer: 150 </div>
                                        <div id="view">View: 7,589 </div>
                                </div>
                        </div>
                        
                        <div id="query">
                                <div class="images1"><img src="images/Letter512px.png" alt="k" width="50" height="44" /></div>
                                <div class="query_question">
                                        <div id="title"><a href="#">Thank to all of Falcuty, I'm better for a month communicated with you? </a></div>
                                        <div id="post">Post by: jimsheom </div>
                                </div>
                                <div class="rate_post">
                                        <div id="answer">Answer: 150 </div>
                                        <div id="view">View: 7,589 </div>
                                </div>
                        </div>-->
            </div>
            <div class="footer"></div>
        </div>
    </body>
</html>
